home *** CD-ROM | disk | FTP | other *** search
- property myParams, currentMarker
-
- on new me
- set myParams to [:]
- return me
- end
-
- on addMarker me, marker, buttonList, buttonDownList, transition
- set newProp to [:]
- setaProp(newProp, #buttons, buttonList)
- setaProp(newProp, #buttonDownStates, buttonDownList)
- setaProp(newProp, #transition, transition)
- setaProp(myParams, marker, newProp)
- end
-
- on setMarker me, marker
- if not voidp(getaProp(myParams, marker)) then
- set currentMarker to marker
- else
- set currentMarker to EMPTY
- end if
- end
-
- on getMarker me
- return currentMarker
- end
-
- on getObjectList me
- if not voidp(getaProp(myParams, currentMarker)) then
- set theProp to getProp(myParams, currentMarker)
- set theObjectList to getProp(theProp, #buttons)
- end if
- return theObjectList
- end
-
- on goMarker me, marker
- if currentMarker = marker then
- exit
- end if
- if not voidp(getaProp(myParams, currentMarker)) then
- set oldProp to getProp(myParams, currentMarker)
- set oldButtonList to getProp(oldProp, #buttons)
- else
- set oldButtonList to []
- end if
- if not voidp(getaProp(myParams, marker)) then
- set theProp to getProp(myParams, marker)
- set buttonList to getProp(theProp, #buttons)
- set buttonDownList to getProp(theProp, #buttonDownStates)
- set trans to getProp(theProp, #transition)
- repeat with b in oldButtonList
- if getOne(buttonList, b) = 0 then
- tell b
- setState(b, 0)
- end tell
- next repeat
- end if
- tell b
- suspend(b)
- end tell
- end repeat
- if not voidp(trans) then
- do("puppetTransition" && trans)
- end if
- go(marker)
- set currentMarker to marker
- repeat with n = 1 to count(buttonList)
- set b to getAt(buttonList, n)
- if getOne(oldButtonList, b) = 0 then
- tell b
- setRadio(b, getAt(buttonDownList, n))
- end tell
- tell b
- setState(b, 1)
- end tell
- next repeat
- end if
- tell b
- unsuspend(b)
- end tell
- end repeat
- end if
- if the freeBlock < (200 * 1024) then
- unLoad()
- end if
- end
-